﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using MengCC.App.Models;
using MengCC.Core.App;
using Microsoft.AspNetCore.Mvc;

namespace MengCC.App.Controllers
{
    public class ApplicationController : Controller
    {
        private AppManager appManager;

        public ApplicationController(AppManager appManager)
        {
            this.appManager = appManager;
        }

        public IActionResult Index()
        {
            return View();
        }

        [HttpPost]
        public async Task<IActionResult> ReStart()
        {
            appManager.ReStart();
            return new JsonResult(new Output
            {
                code = 1
            });
        }

    }
}